package CSDN;

/**
 * Created with IntelliJ IDEA.
 * Description: 懒汉模式
 * User: 王圆豪
 * Date: 2025-05-11
 * Time: 22:44
 */

class SingleLazy{
    private volatile static SingleLazy intance = null;

    private SingleLazy(){}

    public SingleLazy getIntance(){
        if (intance == null){
            synchronized (this){
                if(intance == null){
                    intance = new SingleLazy();
                }
            }
        }
        return intance;
    }
}
public class Test20 {
    public static void main(String[] args) {
//        SingleLazy singleLazy = new SingleLazy();
    }
}
